﻿using System;
using AdAggregator.Advertisement;

namespace AdAggregator.Monitoring
{
    public class PriceMonitoring<TPricedAdvertisement> where TPricedAdvertisement : IPricedAdvertisement
    {
        public static void StartMonitoringTask(IMonitoringTask task, TPricedAdvertisement lastAd, Action<IMonitoringResult<TPricedAdvertisement>> callback)
        {
            PriceMonitoringRegistry<TPricedAdvertisement>.RegisterTask(task, lastAd, callback);
        }

        public static void StopMonitoringTask(IMonitoringTask task)
        {
            PriceMonitoringRegistry<TPricedAdvertisement>.UnregisterTask(task);
        }
    }
}
